<?php
/**
 * 启动脚本
 */
namespace core;
// 加载常量
require ROOT_PATH .'/core/define.php';
// 加载 配置文件
require ROOT_PATH .'/core/common.php';
require_once ROOT_PATH .'/core/App.php';

try {
	if(PHP_SAPI == 'cli'){
		(new App())->cli();
	}else{
		(new App())->run();
	}
} catch (\Exception $e) {
	$msg = "ERROR : ".$e->getMessage() . " ~~~ ERRNO :". $e->getCode() . " File :".$e->getFile() . " Line :".$e->getLine();
	ajaxReturn($msg);

} catch (\Error $e){

	$msg = "ERROR : ".$e->getMessage() . " ~~~ ERRNO :". $e->getCode() . " File :".$e->getFile() . " Line :".$e->getLine();
	ajaxReturn($msg);

}

